package com.tdkj.service.information.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.tdkj.dao.information.IBeanBaseInfoDao;
import com.tdkj.model.information.BeanBaseInfo;
import com.tdkj.service.BaseService;
import com.tdkj.service.information.IBeanSpotGoodService;
@Component("spotGoodService")
public class BeanSpotGoodImpl extends BaseService implements IBeanSpotGoodService{
	private IBeanBaseInfoDao baseInfoDao;

	public IBeanBaseInfoDao getBaseInfoDao() {
		return baseInfoDao;
	}

	@Resource
	public void setBaseInfoDao(IBeanBaseInfoDao baseInfoDao) {
		this.baseInfoDao = baseInfoDao;
	}

	@Override
	public void deleteSpotGood(Long id) {
		// TODO Auto-generated method stub
		BeanBaseInfo bean=baseInfoDao.findById(id, BeanBaseInfo.class);
		baseInfoDao.delete(bean);
	}

	@Override
	public List<BeanBaseInfo> findSpotGoods() {
		// TODO Auto-generated method stub
		BeanBaseInfo bean=new BeanBaseInfo();
		bean.setModuletype("14");
		bean.setColumntype("2");
		return baseInfoDao.findByExample(bean);
	}

	@Override
	public BeanBaseInfo findSpotGood(Long id) {
		return baseInfoDao.findById(id, BeanBaseInfo.class);
	}

	@Override
	public void updateStatus(Long id) {
		// TODO Auto-generated method stub
		BeanBaseInfo bean=baseInfoDao.findById(id, BeanBaseInfo.class);
		bean.setStatus("已审核");
		baseInfoDao.merge(bean);
	}

	
}
